﻿@model IEnumerable<ADShop.Models.ImagesProduct>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create", null, new { @class = "btn btn-green" })
</p>
<div class="panel panel-default">
    <div class="panel-heading">
        <i class="fa fa-external-link-square"></i>
        Danh Mục Nhà Sản Xuất
        <div class="panel-tools">
            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
            </a>
            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                <i class="fa fa-wrench"></i>
            </a>
            <a class="btn btn-xs btn-link panel-refresh" href="#">
                <i class="fa fa-refresh"></i>
            </a>
            <a class="btn btn-xs btn-link panel-expand" href="#">
                <i class="fa fa-resize-full"></i>
            </a>
            <a class="btn btn-xs btn-link panel-close" href="#">
                <i class="fa fa-times"></i>
            </a>
        </div>
    </div>
    <div class="panel-body">
        <table class="table table-hover" id="sample-table-1">
            <thead>
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.IDImagesProduct)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Product.NameProduct)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.LinkImagesProduct)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.DescriptionImages)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Active)
                    </th>
                    <th>Chức năng</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            @item.IDImagesProduct
                        </td>

                        <td>
                            @Html.ActionLink(@item.Product.NameProduct, "Details", new { id = @item.IDImagesProduct })
                            @*@Html.DisplayFor(modelItem => item.Product.NameProduct)*@
                        </td>
                        <td>
                           <img src="@item.LinkImagesProduct" width="100" height="100" />
                        </td>
                        <td>
                            @item.DescriptionImages
                        </td>
                        <td>
                            @item.Active
                        </td>
                        <td>
                            @Html.ActionLink("Sửa", "Edit", new { id = item.IDImagesProduct }, new { @class = "label label-warning" })
                            @Html.ActionLink("Xóa", "DeleteConfirmed", new { id = item.IDImagesProduct }, new { @class = "label label-danger", onclick = "return confirm('Are you sure to delete this item?')" })
                        </td>
                    </tr>
                }
                </tbody>

</table>
    </div>
